using System.Text.Json;

namespace IMClient.Model.Message
{
    public class JoinGroupRequest : ReqSystemMessage
    {
        public override string SystemType => "JoinGroupRequest";
        
        public string GroupId { get; set; } = null!;
        
        public string GroupName { get; set; } = null!;
        
        public string GroupAvatar { get; set; } = null!;
        
        public string GroupCreator { get; set; } = null!;

        public string Description { get; set; } = string.Empty;

        public override string ToJson()
        {
            var requestData = new
            {
                MessageId,
                SenderId,        // 申请人ID
                SenderName,      // 申请人名称
                SenderAvatar,    // 申请人头像
                ReceiverId,      // 群主ID
                Content,         // 申请内容
                MessageType,     // SYSTEM
                SystemType,      // JoinGroupRequest
                GroupId,         // 群组ID
                GroupName,       // 群组名称
                GroupAvatar,     // 群组头像
                GroupCreator,    // 群主ID
                Description      // 申请描述
            };
            return JsonSerializer.Serialize(requestData);
        }
    }
} 